#ifndef __LDX_CLIGHTSCENENODE_H_INCLUDE__
#define __LDX_CLIGHTSCENENODE_H_INCLUDE__
#include "LDXConfig.h"
#include "ISceneNode.h"
#include "DCBufferDefines.h"

namespace ldx
{
	namespace scene
	{

		class CLightSceneNode :public ISceneNode
		{
		public:
			CLightSceneNode(ISceneNode* parent, CSceneManager* mgr, int id = -1,
				mt::vec4f position = mt::vec4f(0, 0, 0, 1),
				mt::vec3f intensities = mt::vec3f(1, 1, 1),
				float attenuation = 0.f,
				float ambientCoefficient = 0.1f, float coneAngle = 180.f,
				mt::vec3f coneDirection = mt::vec3f(0, 0, 0));

			void initLight(mt::vec4f position = mt::vec4f(0, 0, 0, 1),
				mt::vec3f intensities = mt::vec3f(1, 1, 1),
				float attenuation = 0.f,
				float ambientCoefficient = 0.01f, 
				float coneAngle = 180.f,
				mt::vec3f coneDirection = mt::vec3f(0, 0, 1));

			//! Build spot light
			void buildSpotLight(
				mt::vec4f position = mt::vec4f(-1, -1, -1, 1),
				mt::vec3f  intensities = mt::vec3f(2, 2, 2),
				float attenuation = 0.1f,
				float ambientCoefficient = 0.06f);

			//! Build parallel light
			void buildParalleLight(mt::vec4f position = mt::vec4f(-1.f, -1.f, -1.f, 0.f),
				mt::vec3f  intensities = mt::vec3f(0.3f, 0.3f, 0.3f),
				float ambientCoefficient = 0.06f);

			//! Build flash light.
			void buildFlashLight(mt::vec4f position = mt::vec4f(-1, -1, -1, 1),
				mt::vec3f  intensities = mt::vec3f(2, 2, 2),
				float attenuation = 0.1f,
				float ambientCoefficient = 0.06f,
				float coneAngle = 15.0f,
				mt::vec3f coneDirection = mt::vec3f(0, 0, -1));

			const render::SLight* getLightData()const ;

			virtual void OnRegisterSceneNode();

		private:

			render::SLight* LightData;

		};
	}
}

#endif//! __LDX_CLIGHTSCENENODE_H_INCLUDE__